import React from 'react';
import RouterLoading from '@/components/Loading';
import { KeepAlive } from 'react-activation';
const LazyRoute = (Component: JSX.Element, isKeepAlive?: boolean) => {
    return (
        <React.Suspense fallback={<RouterLoading fullScreen />}>
            {isKeepAlive ? <KeepAlive>{Component}</KeepAlive> : Component}
        </React.Suspense>
    );
};

export default LazyRoute;
